﻿using System;
using eLearning.Model;

namespace eLearning.Model
{

    public enum PostSide
    {
        Me,
        You
    }

    /// <summary>
    /// An Post message
    /// </summary>
    public class Post
    {
        private static DateTime _now = DateTime.Now;
        private static Random _rand = new Random();

        public Post()
        {
            Created = _now;
            _now = _now.AddMinutes(_rand.Next(100));
        }

        public string Id { get; set; }
        public string Comment { get; set; }
        public PostSide Side { get; set; }
        public DateTime Created { get; set; }
        public Thread Forum { get; set; }
        public User Sender { get; set; }

        private string _CreatedStr;
        public string CreatedStr
        {
            set { this._CreatedStr = value; }
            get { return "Dikirim: " + Created.ToString("dd, MMMM yyyy"); }
        }
    }
}
